package elven.codingit.easysearch.model.dto;

import org.apache.lucene.store.FSDirectory;

/**
 * 索引查询dto
 * @author liuyy
 * @date 2016年8月26日
 */
public class IndexSearchDto {

	private int page = 1;
	private int rows = 5;
	private String keyword;
	private int start;
	private int end;
	private FSDirectory fsDirectory;
	private int searchType; 
	
	public int getPage() {
		return page;
	}
	public void setPage(int page) {
		page = page < 1 ? 1 : page;
		this.page = page;
	}
	public int getRows() {
		return rows;
	}
	public void setRows(int rows) {
		rows = rows <= 0 ? 5 : rows;
		this.rows = rows;
	}
	public String getKeyword() {
		return keyword;
	}
	public void setKeyword(String keyword) {
		this.keyword = keyword;
	}
	public int getStart() {
		start = (page - 1) * rows;
		return start;
	}
	public int getEnd() {
		end = page * rows;
		return end;
	}
	public void setStart(int start) {
		this.start = start;
	}
	public void setEnd(int end) {
		this.end = end;
	}
	public FSDirectory getFsDirectory() {
		return fsDirectory;
	}
	public void setFsDirectory(FSDirectory fsDirectory) {
		this.fsDirectory = fsDirectory;
	}
	public int getSearchType() {
		return searchType;
	}
	public void setSearchType(int searchType) {
		this.searchType = searchType;
	}
	
}
